﻿package Engine.RMI
{
    import Framework.Serialize.*;

    public class ERMIMessageType extends Object
    {
        public var __value:int;
        private static const __T:Array = ["MessageTypeCall", "MessageTypeCallRet", "MessageTypeCallRedirect", "MessageTypeCallRetRedirect", "MessageTypeMQ"];
        private static var __values:Array = new Array();
        public static const _MessageTypeCall:int = 0;
        public static const MessageTypeCall:ERMIMessageType = new ERMIMessageType(_MessageTypeCall);
        public static const _MessageTypeCallRet:int = 1;
        public static const MessageTypeCallRet:ERMIMessageType = new ERMIMessageType(_MessageTypeCallRet);
        public static const _MessageTypeCallRedirect:int = 2;
        public static const MessageTypeCallRedirect:ERMIMessageType = new ERMIMessageType(_MessageTypeCallRedirect);
        public static const _MessageTypeCallRetRedirect:int = 3;
        public static const MessageTypeCallRetRedirect:ERMIMessageType = new ERMIMessageType(_MessageTypeCallRetRedirect);
        public static const _MessageTypeMQ:int = 4;
        public static const MessageTypeMQ:ERMIMessageType = new ERMIMessageType(_MessageTypeMQ);

        public function ERMIMessageType(param1:int)
        {
            this.__value = param1;
            __values[param1] = this;
            return;
        }// end function

        public function value() : int
        {
            return this.__value;
        }// end function

        public function toString() : String
        {
            return __T[this.__value];
        }// end function

        public function equals(param1:Object) : Boolean
        {
            if (param1 == this)
            {
                return true;
            }
            var _loc_2:* = param1 as ERMICallModel;
            if (_loc_2 == null)
            {
                return false;
            }
            return this.__value == _loc_2.value();
        }// end function

        public function hashCode() : int
        {
            return 5 * this.__value;
        }// end function

        public function __write(param1:SerializeStream) : void
        {
            param1.writeByte(this.__value);
            return;
        }// end function

        public static function convert(param1:int) : ERMIMessageType
        {
            return __values[param1];
        }// end function

        public static function __read(param1:SerializeStream) : ERMIMessageType
        {
            var _loc_2:* = param1.readByte();
            if (_loc_2 < 0 || _loc_2 >= 5)
            {
                throw new MarshalException();
            }
            return ERMIMessageType.convert(_loc_2);
        }// end function

    }
}
